package entities;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.jdo.annotations.Index;
import javax.persistence.Id;

import com.googlecode.objectify.annotation.Cached;
import com.googlecode.objectify.annotation.Indexed;
import com.googlecode.objectify.annotation.NotSaved;
import com.googlecode.objectify.annotation.Unindexed;

@SuppressWarnings("serial")
@Cached
public class Article implements Serializable {
	@Id private String id = "";
	
	@Indexed private String url = "";
	
	@Unindexed private String autoSite = "";
	
	@Indexed private String alias = "";
	
	/**
	 * 0 - Unpublished
	 * 1 - Published
	 * 2 - Need review
	 */
	@Indexed int status = 1;
	
	@Unindexed private String title = "";
	
	@Unindexed private String description = "";
	
	@Unindexed private String content = "";
	
	@Unindexed private boolean displaySource = false;
	
	@Indexed private Date created = new Date();
	
	@Indexed private String creator = "";
	
	@Indexed private String category = "";
	
	@Unindexed private String tags = "";
	
	@Indexed private String language = "en"; //en, es, pt
	
	@Indexed private boolean primaryLanguage = false;
	
	@Unindexed private String email = "";
	
	@Unindexed private String authorName = "";
	
	@NotSaved private String oldAlias = "";
	
	@Unindexed private List<String> keywords = new ArrayList<String>(); 
	
	@Unindexed private String website = "";
	
	@Unindexed private String authKey = "";
	
	@Unindexed private int rate = 3;
	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getAutoSite() {
		return autoSite;
	}

	public void setAutoSite(String autoSite) {
		this.autoSite = autoSite;
	}

	public String getAlias() {
		return alias;
	}

	public void setAlias(String alias) {
		this.alias = alias;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public boolean isDisplaySource() {
		return displaySource;
	}

	public void setDisplaySource(boolean displaySource) {
		this.displaySource = displaySource;
	}

	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	public String getCreator() {
		return creator;
	}

	public void setCreator(String creator) {
		this.creator = creator;
	}

	public String getCategory() {
		return category;
	}

	public void setCategory(String category) {
		this.category = category;
	}

	public String getTags() {
		return tags;
	}

	public void setTags(String tags) {
		this.tags = tags;
	}

	public String getLanguage() {
		return language;
	}

	public void setLanguage(String language) {
		this.language = language;
	}
	
	public boolean isPrimaryLanguage() {
		return primaryLanguage;
	}

	public void setPrimaryLanguage(boolean primaryLanguage) {
		this.primaryLanguage = primaryLanguage;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getAuthorName() {
		return authorName;
	}

	public void setAuthorName(String authorName) {
		this.authorName = authorName;
	}

	public String getOldAlias() {
		return oldAlias;
	}

	public void setOldAlias(String oldAlias) {
		this.oldAlias = oldAlias;
	}

	public List<String> getKeywords() {
		return keywords;
	}

	public void setKeywords(List<String> keywords) {
		this.keywords = keywords;
	}

	public String getWebsite() {
		return website;
	}

	public void setWebsite(String website) {
		this.website = website;
	}

	public String getAuthKey() {
		return authKey;
	}

	public void setAuthKey(String authKey) {
		this.authKey = authKey;
	}

	public int getRate() {
		return rate;
	}

	public void setRate(int rate) {
		this.rate = rate;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

}
